recursive algorithm

join shbcf.ru